/*
 * @Author: sdq 483657864@qq.com
 * @Date: 2025-04-17 16:44:36
 * @LastEditors: sdq 483657864@qq.com
 * @LastEditTime: 2025-04-21 13:51:35
 * @FilePath: \ranyu_anchor_new\src\store\modules\agroa\config.ts
 * @Description:使用声网初始化配值
 */
import { ClientRole, type UID } from "agora-rtc-sdk-ng";
import { defineStore } from "pinia";
/**
 * 语音聊天室配置接口
 * @property appId - 声网项目 App ID（必须）
 * @property token - 动态生成的频道鉴权 Token（必须）
 * @property channel - 频道名称（必须）
 * @property uid - 用户唯一标识（建议由服务端生成）
 * @property role - 初始用户角色，默认观众
 */
interface VoiceConfig {
  appId: string;
  token: string;
  channel: string;
  uid: UID;
  role: ClientRole;
}
export const useVoiceConfigStore = defineStore("voiceconfig", {
  state: (): VoiceConfig => ({
    appId: "4487c53bb8a548508ffe17fceb321334",
    token:
      "007eJxTYOCOYrz693Biu1yXre7bBa+nC8SKvr1UkhQ8f+8slQc/505SYDAxsTBPNjVOSrJINDWxMDWwSEtLNTRPS05NMjYyNDY2eXiHNaMhkJFBe+dBZkYGCATxORnK8jOTU4Py83MZGAA1QyKd",
    channel: "voiceRoom",
    uid: "123456",
    role: "host",
  }),
  actions: {
    async SET_VOICE_CONFIG(config: any) {
      Object.assign(this, config);
    },
  },
});
